"""
python 操作redis 实现消息发布订阅
"""
import redis
client = redis.StrictRedis(password='123456')
print(client)
# 消息的发布
# client.publish('foodchat', 'tomato')

# 重复发送多条信息
while True:
    msg = input("请输入您要发布的信息：")
    if msg.upper() == 'Q':
        break
    client.publish('footchat', msg)

client.close()
